home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qpicture.h.z / qpicture.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  1.9 KB  |  83 lines

  1. /****************************************************************************
  2. ** $Id: qpicture.h,v 2.6 1998/07/03 00:09:37 hanord Exp $
  3. **
  4. ** Definition of QPicture class
  5. **
  6. ** Created : 940729
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QPICTURE_H
  25. #define QPICTURE_H
  26.  
  27. #ifndef QT_H
  28. #include "qpaintdevice.h"
  29. #include "qbuffer.h"
  30. #endif // QT_H
  31.  
  32.  
  33. class QPicture : public QPaintDevice        // picture class
  34. {
  35. public:
  36.     QPicture();
  37.    ~QPicture();
  38.  
  39.     bool    isNull() const;
  40.  
  41.     uint    size() const;
  42.     const char *data() const;
  43.     void    setData( const char *data, uint size );
  44.  
  45.     bool    play( QPainter * );
  46.  
  47.     bool    load( const char *fileName );
  48.     bool    save( const char *fileName );
  49.  
  50. protected:
  51.     bool    cmd( int, QPainter *, QPDevCmdParam * );
  52.     int        metric( int ) const;
  53.  
  54. private:
  55.     bool    exec( QPainter *, QDataStream &, int );
  56.     QBuffer    pictb;
  57.     int        trecs;
  58.     bool    formatOk;
  59.  
  60. private:    // Disabled copy constructor and operator=
  61.     QPicture( const QPicture & );
  62.     QPicture &operator=( const QPicture & );
  63. };
  64.  
  65.  
  66. inline bool QPicture::isNull() const
  67. {
  68.     return pictb.buffer().isNull();
  69. }
  70.  
  71. inline uint QPicture::size() const
  72. {
  73.     return pictb.buffer().size();
  74. }
  75.  
  76. inline const char *QPicture::data() const
  77. {
  78.     return pictb.buffer().data();
  79. }
  80.  
  81.  
  82. #endif // QPICTURE_H
  83.